/*
 * 猴子吃桃程序_扩展2（4分）
 *
 * 猴子吃桃程序_扩展1，见：05-week05/8_Monkey_Eat_Peach_Extension_1.c
 */

#include <stdio.h>

int main() {
	setbuf(stdout, NULL);

	int days = 0, peach_remain = 1;
	int get_return;

	// note: 获取正确的输入
	do {
		printf("Input days:\n");
		get_return= scanf("%d", &days);
		// while (getchar() != '\n');
		setbuf(stdin, NULL);
	} while (get_return != 1 || days
	<= 0);

	// note: 计算桃子的的总数
	for (int i = 0; i < days - 1; ++i) {
		peach_remain = 2 * (peach_remain + 1);
	}

	printf("x=%d\n", peach_remain);

	return 0;
}